package com.getword.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.getword.utils.jsonserialize.ArticleCollectDateSerializer;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;


@Document("articleCollect")
@Setter
@Getter
@ToString
public class ArticleCollect implements Serializable {
    @Id
    @Field("_id")
    private String id;
    private Long userId;
    private String articleId;
    private Long gradeId;
    @Transient
    private Article article; // extend
    @JsonSerialize(using = ArticleCollectDateSerializer.class)
    private Date collectTime;

}
